<?php
/**
* Bootstrap Doctrine.php, register autoloader specify
* configuration attributes and load models.
*/
//var_dump(__FILE__);
require_once(dirname(__FILE__).'/vendor/doctrine/Doctrine.php');
define('MODELS_DIR','../models');
spl_autoload_register(array('Doctrine', 'autoload'));
$manager = Doctrine_Manager::getInstance();

$manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);
// SET CONSERVATIVE MODEL LOADING
$manager->setAttribute(Doctrine::ATTR_MODEL_LOADING,Doctrine::MODEL_LOADING_CONSERVATIVE);

$manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);

//give access to function when you are working with theUserTableinstance:
$manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);

//$dsn = 'mysql:dbname=confab_client;host=127.0.0.1';
//$user = 'root';
//$password = '';
//$dbh = new PDO($dsn, $user, $password);
//$conn = Doctrine_Manager::connection($dbh);

$conn = Doctrine_Manager::connection('mysql://root:@localhost/confab_client','doctrine');

// all found classes will becached internally so the autoloader can require them later.
Doctrine::loadModels(MODELS_DIR);
